package com.gagakuai.bpm.common.component;



import com.gagakuai.bpm.domian.events.BaseEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/*
 * @program: bpm_server
 * @description: 发布器
 * @author: houhong
 * @create: 2022-05-07 15:52
 */
@Component
public class PublisherContext {

    @Autowired
    private ApplicationContext applicationContext;

    /*
     * 发送spring容器事件入口方法
     */
    public <T extends BaseEvent> void publish(T t) {
        applicationContext.publishEvent(t);
    }
}